package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30);not null;unique;comment:用户表"json:"username"`
	Password string `gorm:"type:varchar(32);not null"json:"password"`
}

func (u *User) GetInitByUsername(username string) error {
	return DB.Where("username=?", username).Limit(1).Find(&u).Error
}
